package org.tio.sitexxx.web.server.http;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.tio.http.common.HttpConfig;
import org.tio.http.common.HttpRequest;
import org.tio.http.common.session.HttpSession;
import org.tio.http.server.session.HttpSessionListener;
import org.tio.sitexxx.service.vo.SessionExt;
import org.tio.sitexxx.service.vo.SessionKey;

/**
 * @author tanyaowu 
 * 2016年9月27日 下午2:04:10
 */
public class TioSiteHttpSessionListener implements HttpSessionListener {
	@SuppressWarnings("unused")
	private static Logger log = LoggerFactory.getLogger(TioSiteHttpSessionListener.class);

	public static final TioSiteHttpSessionListener ME = new TioSiteHttpSessionListener();

	/**
	 * 
	 * @author: tanyaowu
	 */
	private TioSiteHttpSessionListener() {
	}

	/** 
	 * @param session
	 * @author: tanyaowu
	 */
	@Override
	public void doAfterCreated(HttpRequest request, HttpSession session, HttpConfig httpConfig) {
		session.setAttribute(SessionKey.SESSION_EXT, new SessionExt(), httpConfig);
	}
}
